package com.qf.controller;

import com.qf.ResultVo;
import com.qf.service.SeatService;
import com.qf.vo.MsgVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者：Xx凯丶
 * 时间：2022/4/22 9:41
 */
@RestController
@RequestMapping("/seat")
@CrossOrigin
public class SeatController {
    @Autowired
    private SeatService seatService;
    @RequestMapping("/searchseat")
    public ResultVo searchSeat(Integer cinemaId,Integer hallId){
        return seatService.searchSeatByCinemaIdAndHallId(cinemaId, hallId);
    }
    @RequestMapping("/searchrow")
    public ResultVo searchRow(Integer cinemaId,Integer hallId){
        return seatService.searchRowByCinemaIdAndHallId(cinemaId, hallId);
    }
    @RequestMapping("/searchmsg")
    public ResultVo searchMsg(Integer cinemaId, Integer movieId, Integer hallId, Integer scenesId){
        MsgVO msgVO = seatService.searchMsgByCinemaIdAndMovieIdAndHallIdAndScenesId(cinemaId, movieId, hallId, scenesId);
        return new ResultVo(200,"SUCCESS",msgVO);
    }
}
